package com.green.home.common.security.component;

import org.springframework.context.annotation.Bean;
import org.springframework.security.oauth2.server.authorization.OAuth2AuthorizationService;
import org.springframework.security.oauth2.server.resource.introspection.OpaqueTokenIntrospector;

/**
 * 资源服务器配置的默认加载类
 * @author limingliang
 * @date 2024/3/7 19:31
 */
public class ResourceServerAutoConfiguration {

    /**
     * 资源服务器toke内省处理器
     * @param authorizationService
     * @return
     */
    @Bean
    public OpaqueTokenIntrospector opaqueTokenIntrospector(OAuth2AuthorizationService authorizationService) {
        return new GreenOpaqueTokenIntrospector(authorizationService);
    }

}
